//header footer加载
function commonPage(url,id){
    $.ajax({
    	type:"get",
    	async:false,
        url:url,
        data : {},
        success : function(data){
        	data = data.slice(data.indexOf('<body>')+6,data.indexOf('</body>'));
        	$("#"+id).html(data);
        }
    });
}
//获取可视区高度设置iframe高度
$(window).resize(function () {
    var h = $(window).height();
    var w = $(window).width();
    if (h > 400) {
        changeHeight();
    }
});
function changeHeight() {
    var h = $(window).height();
    var w = $(window).width();
    if (w > 1200) {
        var iHeight = h - 50;
        var rightCont = iHeight - 66;
        $('.main-right').height(iHeight);
        $('.main-left').height(iHeight);
        $('#rightCont').height(rightCont);
    } else if (768 < w < 1200) {
        var iHeight = h - 50;
        var rightCont = iHeight - 66;
        $('.main-right').height(iHeight);
        $('.main-left').height(iHeight);
        $('#rightCont').height(rightCont);
    }
};
function setDefaultLeftMenu(){
  console.log("##d_common.js:setDefaultLeftMenu");
}
$(function () {
	commonPage('../../common_page/d_leftMenu.html','leftMenu');
    commonPage('../../common_page/d_header.html','header');
    commonPage('../../common_page/footer.html','footer');
    changeHeight();
});